home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / compuserve-file-archive / 08 System Utilities / MIME.BIN (.txt) < prev    next >
Commodore BASIC  |  2019-04-13  |  4KB  |  95 lines

  1. 10 POKE55,.:POKE56,27:CLR:Z$=CHR$(.):M$=CHR$(13):Q$=CHR$(34)
  2. 20 I$="ENTER DEVICE # OF ":O$="[157] NOT PRESENT":GOSUB900
  3. 24 Q=.:PRINT"[147][142]"
  4. 25 PRINTI$;"SOURCE DRIVE.":PRINT"(ENTER 0 TO EXIT.)"
  5. 35 PRINT"  8[145]":INPUTD:IFD=.THENGOSUB800:END
  6. 40 IFD<4ORD>30THENGOSUB700:GOTO25
  7. 45 POKE2,36:POKE184,8:POKE185,0:POKE186,D
  8. 50 POKE183,1:POKE187,2:POKE188,.:SYS65472
  9. 55 CLOSE8:IFPEEK(144)THENPRINT"[147]?DEVICE";D;O$:GOTO25
  10. 57 Y=15:OPENY,D,15:GOSUB500:IFA>19THENCLOSEY:GOTO25
  11. 60 PRINT"[147]";
  12. 65 PRINT"PRESS D FOR DIRECTORY.":PRINT"PRESS S TO START OVER."
  13. 75 PRINT"PRESS F TO ENTER SOURCE FILENAME."
  14. 80 GETA$:IFA$="D"THENOPEN8,D,0,"$":SYS5288:PRINT"[147]";:GOTO65
  15. 85 IFA$="S"THENPRINT"[147]":CLOSEY:GOTO25
  16. 90 IFA$="F"THENPRINT"[147]";:GOTO100
  17. 95 GOTO80
  18. 100 PRINT"ENTER FILENAME.":PRINT"(PRESS RETURN TO START OVER.)"
  19. 105 F$="":INPUTF$:IFF$=""THENCLOSEY:GOTO24
  20. 110 CLOSE8:Y=15:OPEN8,D,8,F$:GOSUB500:IFA>19THEN100
  21. 120 GOSUB600:IFQTHENQ=.:GOTO130
  22. 125 PRINT"[147]"
  23. 130 PRINTI$;"DESTINATION DRIVE":PRINT"(ENTER 0 TO START OVER.)"
  24. 140 PRINT"  8[145]":INPUTE:IFE=.THENGOSUB805:PRINT:GOTO24
  25. 145 IFE<4ORE>30THENGOSUB700:GOTO130
  26. 150 POKE251,36:POKE252,36:POKE184,9:POKE185,0:POKE186,E
  27. 155 POKE183,2:POKE187,251:POKE188,.:SYS65472
  28. 160 IFPEEK(144)THENPRINT"[147]?DEVICE";E;O$:CLOSE9:GOTO130
  29. 165 Y=16:OPENY,E,15:GOSUB500:IFA>19THENCLOSE9:CLOSEY:Q=1:GOTO110
  30. 170 PRINT"[147]0 ";:FORI=1TO6:GET#9,A$:NEXT
  31. 180 GET#9,A$:IFA$=""THENPRINT:GOTO190
  32. 185 PRINTA$;:GOTO180
  33. 190 GET#9,A$:GET#9,A$:GET#9,A$:K=ASC(A$+Z$):GET#9,A$:K=K+256*ASC(A$+Z$)
  34. 205 PRINT"[157]";K;
  35. 210 GET#9,A$:PRINTA$;:IFSTTHEN220
  36. 215 GOTO210
  37. 220 CLOSE9:PRINT:PRINT"SOURCE FILENAME: ";F$:PRINT"[157]";N;"BLOCKS"
  38. 230 IFINT((12954*N-70)/17780)+1<=KTHEN237
  39. 231 PRINT"THERE MAY BE INSUFFICIENT ROOM ON YOUR"
  40. 232 PRINT"DISK FOR THE DECODED FILE."
  41. 233 PRINT"GO FOR IT? (Y/N)"
  42. 234 GETA$:IFA$="Y"THEN237
  43. 235 IFA$="N"THENCLOSEY:GOTO110
  44. 236 GOTO234
  45. 237 PRINT"ENTER DESTINATION FILENAME."
  46. 240 PRINT"(ENTER * FOR SAME FILENAME.)"
  47. 242 PRINT"(PRESS RETURN TO REENTER DEVICE #.)"
  48. 245 G$="":INPUTG$:IFG$=""THENCLOSEY:GOTO110
  49. 247 IFG$="*"THENG$=F$
  50. 250 OPEN9,E,1,G$:GOSUB500:IFA>19THENCLOSE9:GOTO237
  51. 260 PRINT"[147]SOURCE FILENAME: ";F$
  52. 265 PRINT"DESTINATION FILENAME: ";G$
  53. 270 PRINT"[157]";N;"BLOCKS TO PROCESS":PRINT"STARTING OPERATION..."
  54. 280 PRINT"   BLOCKS READ          BLOCKS WRITTEN"
  55. 285 PRINT"   [163][163][163][163][163][163][163][163][163][163][163]          [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  56. 290 PRINT"       000                    000"
  57. 400 SYS5507:IFPEEK(782)=255THEN408
  58. 402 SYS65484:POKE56334,17
  59. 403 PRINT"INVALID FILE; DELETE? (Y/N)"
  60. 404 GETA$:IFA$="Y"THEN407
  61. 405 IFA$="N"THEN410
  62. 406 GOTO404
  63. 407 CLOSE9:PRINT#16,"S0:";G$:PRINT"DELETING ";Q$;G$;Q$;"...":GOTO410
  64. 408 SYS5655:IFPEEK(2)THEN403
  65. 409 PRINT"...DONE.  FILE DECODED."
  66. 410 GOSUB800:PRINT"PRESS RETURN."
  67. 415 GETA$:IFA$=M$THEN24
  68. 420 GOTO415
  69. 500 INPUT#Y,A,B$,C,Z:IFA<20THENRETURN
  70. 510 PRINT:PRINTA:PRINT:PRINTB$:PRINT:PRINTC,Z:PRINT:RETURN
  71. 600 PRINT#15,"M-R";CHR$(144);CHR$(2);CHR$(5)
  72. 605 GET#15,A$:S=ASC(A$+Z$):GET#15,A$:GET#15,A$:GET#15,A$
  73. 615 GET#15,A$:P=ASC(A$+Z$):OPEN5,D,5,"#":PRINT#15,"U1";5;.;18;S
  74. 630 PRINT#15,"B-P";5;P+28:GET#5,A$:N=ASC(A$+Z$):GET#5,A$:N=N+256*ASC(A$+Z$)
  75. 645 PRINT#15,"B-P";5;P+3:I=.:F$=""
  76. 655 GET#5,A$
  77. 660 IFI=16ORA$="[160]"THENCLOSE5:RETURN
  78. 665 F$=F$+A$:I=I+1:GOTO655
  79. 700 PRINT"[147]ILLEGAL DEVICE NUMBER":RETURN
  80. 800 POKE56,160
  81. 805 CLOSE15:CLOSE16:CLOSE8:CLOSE9:RETURN
  82. 900 PRINT"[147]    [212]HIS FILE IS FOR THE [195]OMMODORE-64."
  83. 905 PRINT"[212]HE PROGRAM WILL DECODE A 7-BIT MESSAGE"
  84. 910 PRINT"CONTAINING BINARY DATA ENCODED USING"
  85. 915 PRINT"THE ";Q$;"[205][201][205][197]/[194]ASE64";Q$;" METHOD.  [198]REQUENTLY,"
  86. 920 PRINT"THE MESSAGE WILL CONTAIN A TEXT HEADER"
  87. 925 PRINT"AND FOOTER; THEY WILL BE IGNORED BY THIS"
  88. 930 PRINT"PROGRAM (THE FOOTER WILL NOT BE READ)."
  89. 935 PRINT"[212]HE DECODED FILE WILL BE A [208][210][199] TYPE;"
  90. 940 PRINT"EITHER ONE OR TWO DISK DRIVES (1541"
  91. 945 PRINT"AND/OR 1571) MAY BE USED."
  92. 997 PRINT"             [[208][210][197][211][211] [210][197][212][213][210][206]][146]";
  93. 998 GETA$:IFA$=M$THENRETURN
  94. 999 GOTO998
  95.